
//调整各版块高度和宽度
var Aside = $('#aside');
var Aside_right = $('.content_right');
var Content = $('#content');
var Listkind = $('.content_left');
var Height = $(window).height();
var Width = $(window).width();
Aside.css('height',Height);
Aside_right.css('height',Height);
Content.css('width',Width-Aside.width()-17);
Listkind.css('width',Content.width()-$('.content_right').width()-40);

//更多操作
function more_feature(){
    if($('#header .feature').height() == '50'){
        $('#header .feature').animate({height: "165px"},200);
    }else{
        $('#header .feature').animate({height: "50px"},200,function(){
            $('#header .branch .fea_onclick').removeClass('fea_onclick');
        });
    }
}
$('#header .more_fun').click(function(){
    more_feature();
});
function more_info_onclck(the){
    $('#header .fea_onclick').removeClass('fea_onclick');
    $(the).addClass('fea_onclick');
}
$('#header .more_info li').click(function () {
    var the = this;
    more_info_onclck(the);
});

//左导航
function task_onclick(the) {
    $('#aside .orange').removeClass('task_onclick');
    $(the).addClass('task_onclick');
}

//任务中心动画
function branch_animate(){
    if($('#aside .branch').height() == '252'){
        $('#aside .branch').animate({height: "189px"}, 70,function(){
            $('#aside .branch').css('padding', '6px 0');
        }).animate({height: "126px"}, 50,function(){
            $('#aside .branch').css('padding', '4px 0');
        }).animate({height: "63px"}, 70,function() {
            $('#aside .branch').css('padding', '2px 0');
        }).animate({height: "36px"}, 40,function() {
            $('#aside .branch').css('padding', '2px 0');
            $('#aside .branch').css('background-color', 'transparent');
        });
    }else{
        $('#aside .branch').css('background-color', '#3f3f3f');
        $('#aside .branch').animate({height: "63px"}, 50,function(){
            $('#aside .branch').css('padding', '2px 0');
        }).animate({height: "126px"}, 60,function(){
            $('#aside .branch').css('padding', '4px 0');
        }).animate({height: "189px"}, 70,function(){
            $('#aside .branch').css('padding', '6px 0');
        }).animate({height: "252px"}, 90,function(){
            $('#aside .branch').css('padding', '8px 0');
        });
    }
}

function branch_onclick(the){
    $('#aside .branch .branch_onclick').removeClass('branch_onclick');
    $(the).addClass('branch_onclick');
}
//判断任务列表是否展开
function if_open(){
    if ($('#aside .branch').height() == '252') {return true;}else{return false;}
}


//任务收起放下
function tasklist(the){
    if($(the).attr('class') == 'more_less more'){
        $(the).removeClass('more');
        $(the).addClass('less');
        $(the).html('收起');
        $(the).parent().find('p').css('display','block');
        $(the).parent().find('h1').css('display','block');
        $(the).parent().find('.summary').css('display','none');
        $(the).parent().find('.title').css('display','block');
        $(the).parent().find('.host').css('display','block');
    }else{
        $(the).removeClass('less');
        $(the).addClass('more');
        $(the).html('查看全文');
        $(the).parent().find('p').css('display','none');
        $(the).parent().find('h1').css('display','none');
        $(the).parent().find('.summary').css('display','block'); 
        $(the).parent().find('.title').css('display','block');
        $(the).parent().find('.host').css('display','block');
    }
}
$('.task_con .more_less').click(function () {
    var the = this;
    tasklist(the);
});

//退出
$('.quit').click(function(){
    $.ajax({url: URL.loginout,success: function(data){
        if (data.state == 200) {
            var location = window.location;
            location.href =data.nextSrc;
        };
    }});
    
})
